﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Linq;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using BLL;

namespace Shopper
{
    public partial class frmHangHoaForm : DevExpress.XtraEditors.XtraForm
    {
        public frmHangHoaForm()
        {
            InitializeComponent();
        }

        private void frmHangHoaForm_Load(object sender, EventArgs e)
        {
            LoaiHangBL loaiHangBl = new LoaiHangBL();
            cbLoaiHang.Properties.DataSource = loaiHangBl.GetData();
            cbLoaiHang.Properties.DisplayMember = "TenLoaiHang";
            cbLoaiHang.Properties.ValueMember = "MaLoaiHang";

            NhaCungCapBL nccBL = new NhaCungCapBL();
            DataTable dtNhaCungCap = nccBL.GetData();
            cbNhaCungCap.Properties.DataSource = dtNhaCungCap;
            cbNhaCungCap.Properties.DisplayMember = "TenNhaCungCap";
            cbNhaCungCap.Properties.ValueMember = "MaNhaCungCap";
        }

        public string TenHang
        {
            get
            {
                return txtTenHang.Text;
            }
            set
            {
                txtTenHang.Text = value;
            }
        }

        public string Dvt {
            get
            {
                return txtDvt.Text;
            }
            set
            {
                txtDvt.Text = value;
            }
        }

        public string DonGia
        {
            get
            {
                return txtDonGia.Text;
            }
            set
            {
                txtDonGia.Text = value;
            }
        }

        public int MaNhaCungCap
        {
            get
            {
                return (int)cbNhaCungCap.EditValue;
            }
            set
            {
                cbNhaCungCap.EditValue = (int)value;
            }
        }

        public int MaLoaiHang
        {
            get
            {
                return (int)cbLoaiHang.EditValue;
            }
            set
            {
                cbLoaiHang.EditValue = (int)value;
            }
        }

        public string MoTa
        {
            get
            {
                return txtMoTa.Text;
            }
            set
            {
                txtMoTa.Text = value;
            }
        }
    }
}